////////////////////////////////////////////////////////////////////////////
//
//  Crytek Engine Source File.
//  Copyright (C), Crytek Studios, 2001.
// -------------------------------------------------------------------------
//  File name:   TagPoint.h
//  Version:     v1.00
//  Created:     10/10/2001 by Timur.
//  Compilers:   Visual C++ 6.0
//  Description: TagPoint object definition.
// -------------------------------------------------------------------------
//  History:
//
////////////////////////////////////////////////////////////////////////////

#ifndef __TagPoint_h__
#define __TagPoint_h__

#if _MSC_VER > 1000
#pragma once
#endif

#include "EntityObject.h"

/*!
 *	CTagPoint is an object that represent named 3d position in world.
 *
 */
class CTagPoint : public CEntityObject
{
public:
	DECLARE_DYNCREATE(CTagPoint)

	//////////////////////////////////////////////////////////////////////////
	// Ovverides from CBaseObject.
	//////////////////////////////////////////////////////////////////////////
	bool Init( IEditor *ie,CBaseObject *prev,const CString &file );
	void InitVariables() {};
	void Display( DisplayContext &disp );
	bool IsScalable() { return false; }

	void BeginEditParams( IEditor *ie,int flags );
	void EndEditParams( IEditor *ie );

	//! Called when object is being created.
	int MouseCreateCallback( CViewport *view,EMouseEvent event,CPoint &point,int flags );
	bool HitTest( HitContext &hc );

	void GetLocalBounds( AABB &box );
	void GetBoundBox( AABB &box );
	//////////////////////////////////////////////////////////////////////////

	virtual void SetHelperScale( float scale );
	virtual float GetHelperScale() { return m_helperScale; };

protected:
	CTagPoint();

	float GetRadius();

	void DeleteThis() { delete this; };

	//! Static, common to all tag points.
	static float m_helperScale;
};

/** Respawn point is a special tag point where player will be respawn at begining or after death.
*/
class CRespawnPoint : public CTagPoint
{
public:
	DECLARE_DYNCREATE(CRespawnPoint)

protected:
	CRespawnPoint();
};

class CSpawnPoint : public CTagPoint
{
public:
	DECLARE_DYNCREATE(CSpawnPoint)

protected:
	CSpawnPoint();
};

/*
	NavigationSeedPoint is a special tag point used to generate the reachable
	part of a navigation mesh starting from his position
*/
class CNavigationSeedPoint : public CTagPoint
{
public:
	DECLARE_DYNCREATE(CNavigationSeedPoint)
	//////////////////////////////////////////////////////////////////////////
	// Ovverides from CBaseObject.
	//////////////////////////////////////////////////////////////////////////
	virtual void Display( DisplayContext &dc );
	virtual int MouseCreateCallback( CViewport *view,EMouseEvent event,CPoint &point,int flags );
	virtual void Done();
	virtual void SetModified(bool boModifiedTransformOnly);

	//////////////////////////////////////////////////////////////////////////
protected:
	CNavigationSeedPoint();
};

class C3DNavVolumeSeed : public CTagPoint
{
public:
	DECLARE_DYNCREATE(C3DNavVolumeSeed)
	virtual void Display( DisplayContext &dc );
	virtual bool Init( IEditor *ie,CBaseObject *prev,const CString &file );

protected:
	C3DNavVolumeSeed();
};

/*!
 * Class Description of TagPoint.	
 */
class CTagPointClassDesc : public CObjectClassDesc
{
public:
	REFGUID ClassID()
	{
		// {7826D64A-080E-46cc-8C50-BA6A6CAE5175}
		static const GUID guid = { 0x7826d64a, 0x80e, 0x46cc, { 0x8c, 0x50, 0xba, 0x6a, 0x6c, 0xae, 0x51, 0x75 } };
		return guid;
	}
	ObjectType GetObjectType() { return OBJTYPE_TAGPOINT; };
	const char* ClassName() { return "StdTagPoint"; };
	const char* Category() { return ""; };
	CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(CTagPoint); };
	virtual const char* GetTextureIcon() { return "Editor/ObjectIcons/TagPoint.bmp"; };
};

/*!
 * Class Description of TagPoint.	
 */
class CRespawnPointClassDesc : public CObjectClassDesc
{
public:
	REFGUID ClassID()
	{
		// {03A22E8A-0AB8-41fe-8503-75687A8A50BC}
		static const GUID guid = { 0x3a22e8a, 0xab8, 0x41fe, { 0x85, 0x3, 0x75, 0x68, 0x7a, 0x8a, 0x50, 0xbc } };
		return guid;
	}
	ObjectType GetObjectType() { return OBJTYPE_TAGPOINT; };
	const char* ClassName() { return "Respawn"; };
	const char* Category() { return "TagPoint"; };
	CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(CRespawnPoint); };
};

class CSpawnPointClassDesc : public CObjectClassDesc
{
public:
	REFGUID ClassID()
	{
		// {03A22E8A-0AB8-41fe-8503-75687A8A50BC}
		// {888401F3-FD0E-4087-906A-27CF9E071999}
		static const GUID guid = { 0x888401f3, 0xfd0e, 0x4087, { 0x90, 0x6a, 0x27, 0xcf, 0x9e, 0x7, 0x19, 0x99 } };
		return guid;
	}
	ObjectType GetObjectType() { return OBJTYPE_TAGPOINT; };
	const char* ClassName() { return "SpawnPoint"; };
	const char* Category() { return "TagPoint"; };
	CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(CRespawnPoint); };
};

class CNavigationSeedPointClassDesc : public CObjectClassDesc
{
public:
	REFGUID ClassID()
	{
		// {6768DC77-9928-48FD-AB43-52CFF156CFE0}
		static const GUID guid = { 0x6768dc77, 0x9928, 0x48fd, { 0xab, 0x43, 0x52, 0xcf, 0xf1, 0x56, 0xcf, 0xe0 } };
		return guid;
	}
	ObjectType GetObjectType() { return OBJTYPE_TAGPOINT; };
	const char* ClassName() { return "NavigationSeedPoint"; };
	const char* Category() { return "AI"; };
	CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(CNavigationSeedPoint); };
};

class CNavVolumeSeedClassDesc : public CObjectClassDesc
{
public:
	REFGUID ClassID()
	{
		// // {82A5E089-1545-429d-AF82-BE30870EF2D7}
		//static const GUID guid = 		{ 0x82a5e089, 0x1545, 0x429d, { 0xaf, 0x82, 0xbe, 0x30, 0x87, 0xe, 0xf2, 0xd7 } };

		// {02C9248D-5B09-4700-B629-FF19343795E9}
		static const GUID guid = 
		{ 0x2c9248d, 0x5b09, 0x4700, { 0xb6, 0x29, 0xff, 0x19, 0x34, 0x37, 0x95, 0xe9 } };
		return guid;
	}

	ObjectType GetObjectType() { return OBJTYPE_TAGPOINT; };
	const char* ClassName() 
	{ 
		return "NavVolumeSeed"; 
	};
	const char* Category() { return "AI"; };
	CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(C3DNavVolumeSeed); };
};



#endif // __TagPoint_h__
